package core
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Shape;

	public class DisplayUtil
	{
		public function DisplayUtil()
		{
		}
		
		public static function removeAllChildRen(target:DisplayObjectContainer):void {
			while(target.numChildren > 0){
				target.removeChildAt(0);
			}
		}
		
		public static function drawRect(w:Number, h:Number):Shape{
			var shape:Shape = new Shape();
			shape.graphics.beginFill(0);
			shape.graphics.drawRect(0, 0, w, h);
			shape.graphics.endFill();
			return shape;
		}
		
		public static function removeChild(value:DisplayObject):void {
			if(value && value.parent){
				value.parent.removeChild(value);
			}
		}
	}
}